home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / emulator / c64 / format.txt < prev    next >
Encoding:
Text File  |  1996-04-28  |  14.8 KB  |  354 lines

  1. C64 Emulators standard files - overview.
  2.  
  3.      This section shows the "normal" files used by each emulator.
  4.  
  5.  
  6.   Program       File type      Identification   Contents
  7.                                (name or method)
  8.  
  9.   c64.zip (PC)  disk image       VC1541.000     683 pcs 256-byte sectors
  10.                 tape image       -              not used
  11.  
  12.   C64S   (PC)   basic rom     }                 contains binary data for:
  13.                 kernel rom    }- romcode.c64    VC1541 (16384 bytes), chargen 
  14.                 chargen rom   }                 (4096),basic (8192) and kernel
  15.                 disk drive rom}                 (8192) = total 36864 bytes
  16.                 program          -              not used
  17.                 disk image 09c   *.d64          683 pcs 256-byte sectors
  18.                            09a,b testdisk.d64
  19.                 tape image       *.t64          ?
  20.  
  21.                  Note: the kernel part is modified.
  22.  
  23.   c64sally.zip  basic rom        A000BFFF.64F   8194 bytes of binary data (1)
  24.    (PC)         kernel rom       D000DFFF.64P   8194 bytes of binary data (1)
  25.                 chargen rom      E000FFFF.64P   4098 bytes of binary data (1)
  26.                 disk drive rom   -              not used
  27.                 program          *.64P          C64 program with load address
  28.                                                 also SEQ files via *.64S
  29.                 disk image       -              not used
  30.                 tape image       -              not used
  31.  
  32.   pc64*.zip     basic rom        *.64B          8192 bytes of binary data
  33.    (PC)         kernel rom       *.64K          8192 bytes of binary data
  34.                 chargen rom      *.64C          4096 bytes of binary data
  35.                 module at $8000  *.64M          8192 or 16384 bytes of binary
  36.                                                 data (8K at $A000 = *.64B)
  37.                 disk drive rom   VC1541.64D     16384 bytes of binary data
  38.                 program          *.P00          C64 program with load address
  39.                                                 preceded by 24 byte header.
  40.                 SEQ data file    *.S00          same as *.P00 with different
  41.                 USR data file    *.U00          | extensions. The 00 can be
  42.                 DEL data file    *.D00          | any numbers if the 16-to-8
  43.                 REL data file    *.R00          | mapping leads to duplicates.
  44.                 disk image       *.D64          683 pcs 256-byte sectors, plus
  45.                                                 optionally 683 bytes error info
  46.                 tape image       -              not used
  47.  
  48.   c64.lzh (ST)  basic rom        c64/_basic     8192 bytes of binary data
  49.                 kernel rom       c64/_kernal    8192 bytes of binary data
  50.                 chargen rom      c64/_font      4096 bytes of binary data
  51.                 disk drive rom   -              not used
  52.                 program          -              C64 program with load address
  53.                 disk image       -              not used
  54.                 tape image       -              not used
  55.  
  56.   x64 (UNIX)    basic rom        basic          8192 bytes of binary data (2)
  57.                 kernel rom       kernel         8192 bytes of binary data (2)
  58.                 chargen rom      -              not used
  59.                 disk drive rom   -              not used
  60.                 program          -              C64 program with load address
  61.                 disk image       magic header   64 byte magic header and
  62.                                                 683 pcs 256-byte sectors
  63.                 tape image       -              not used
  64.                  rom module       filename       8192 or 16384 byte cartridge,
  65.                                                  stored in binary format
  66.                 ram image        ram            RAMSIZE + 4103
  67.                    (x64 will load a ram image, eg. "the contents of RAM as
  68.                     in warm start" at startup, if one exists)
  69.                    Only the RAM is loaded at startup. CPU registers and I/O
  70.                    are loaded only via 'undump' in the monitor. (That way it
  71.                    won't keep crashing all the time.)
  72.  
  73.                 (1) Includes load address.
  74.                 (2) Default load address allowed.
  75.  
  76.  
  77.    5.2 Table of supported file formats.
  78.  
  79.      This section shows which emulators can access which file formats,
  80.      unaltered.  It is quite incomplete!
  81.  
  82.      Legend used in table:
  83.        (Legend changed for fast grasp, thanks Wolfgang!)
  84.  
  85.        x = yes, fully supported, c = convertor provided, - = no, and
  86.        empty = unknown.
  87.  
  88.                      x64dsk   d64   t64   p00   CBM
  89.        X64              x      c                 x
  90.        PC64 1.10        -      x     c     x     c
  91.        C64S 1.1A        -      x     x     c     c
  92.        C64Alive 0.9ah   -      -     -     -     x
  93.  
  94.  
  95.    5.3 Standard data files - internal formats.
  96.  
  97.      This section shows the internal format used by each filetype.  Most of
  98.      it was taken from the compatibility section of the x64 manual, and was
  99.      provided by Jouko 'Jopi' Valta.  That section is based on the information
  100.      acquired from news articles written by:
  101.       blohm@mathematik.uni-ulm.de (Guntram Blohm)
  102.       kbrisley@tsegw.tse.com      (Kevin Brisley)
  103.  
  104.  
  105.        File:  ram (x64)         Total Size: RAMSIZE + 4013
  106.        ---------------------------------------------------
  107.        Offset   Bytes      Description
  108.        0        RAMSIZE    contents of the RAM
  109.  
  110.      The following data is not included yet:
  111.        RAMSIZE   4096      I/O area with shadows
  112.        7                  CPU Registers: PC (LO/HI), AC, XR, YR, PS, SP
  113.  
  114.  
  115.         File:  x64 Disk File      Total Size: 174912
  116.        ------------------------------------------
  117.        Offset   Bytes      Description
  118.         0          4         Magic header: 'C',0x15, 0x41, 0x64
  119.  
  120.         4          4         Header Version:
  121.                          C1541 Version Major
  122.                          C1541 Version Minor
  123.                          Device Type:   0 = 1541
  124.                          Max Tracks:   35  (from disks v1.2 upwards)
  125.  
  126.        64      256 byte sectors
  127.  
  128.  
  129.        File:  *.d64 disk image   Total Size: 174878
  130.        ------------------------------------------
  131.        
  132.  
  133.       D64 file contains all sectors as they appear on the 1541 formatted disk.
  134.       Each sector is 256 bytes long. Error information (1 byte per sector)
  135.       can be added in the end of file.
  136.  
  137.       __________________________________
  138.       File types currently supported
  139.  
  140.       174848 bytes = 35 tracks
  141.       175531 bytes = 35 tracks + 683 bytes error information
  142.       196608 bytes = 40 tracks
  143.       197376 bytes = 40 tracks + 768 bytes error information
  144.  
  145.       _______________
  146.       Track sizes
  147.  
  148.       Tracks, size
  149.         1-17   21 sectors * 256 bytes
  150.        18-24   19 sectors * 256 bytes
  151.        25-30   18 sectors * 256 bytes
  152.        31-35   17 sectors * 256 bytes
  153.       *36-40*  17 sectors * 256 bytes
  154.  
  155.       Tracks 36-40 are non-standard.
  156.  
  157.       ____________________________________
  158.       Actual layout for 35 track image
  159.  
  160.        Offset, size, description
  161.         0*256, 256   track 1, sector 0
  162.         1*256, 256   track 1, sector 1
  163.          ...
  164.        20*256, 256   track 1, sector 20
  165.        21*256, 256   track 2, sector 0
  166.          ...
  167.       682*256, 256   track 35, sector 16
  168.       683*256, 683   error info (byte per sector in the same order)
  169.  
  170. Sectors are 256 bytes. Sector 0 is at offset $00000 in the .d64 file.
  171. Sector 1 is at offset $00100 in the .d64 file, and so on.
  172.  
  173. A normal 1541-format disk is divided into 4 'zones' -
  174. zone 1 = tracks 1-17 with 21 sectors (numbered 0-20)
  175. zone 2 = tracks 18-24 with 19 sectors (numbered 0-18)
  176. zone 3 = tracks 25-30 with 18 sectors (numbered 0-17)
  177. zone 4 = tracks 31-35 with 17 sectors (numbered 0-16)
  178.  
  179.   The directory lies on track 18.  The following info is for
  180.   track 18 -
  181.   sector 0 =      Block Availability Map (bytes 00-8f, bitmapped)
  182.                   bytes 90-9f = disk name (16 chars, space padded)
  183.                   The first 2 bytes are track and sector to the
  184.                   first directory block. Usually the first directory
  185.                   block is the very next block on the disk
  186.   directory blocks:
  187.                   byte 0 = track of next directory block
  188.                   byte 1 = sector of next directory block
  189.                   bytes 2-31 = file entry #1
  190.                   bytes 32-33 = unused (should be 0)
  191.                   bytes 34-63 = file entry #2
  192.                   bytes 64-65 = unused,  etc etc
  193.   The first byte of a file entry is the type of file ($82 = PRG,
  194.   $81 = SEQ, $83 = USR, $80 = DEL, $84 = REL).  The next two bytes
  195.   point to the track & sector of the first sector of the file.
  196.   The next 16 bytes is the filename (padded).  The last two bytes
  197.   (i.e. bytes 30 & 31) gives the block count of the file (in low
  198.   byte/high byte format).
  199.  
  200.   Each file block has 254 bytes of data, unless it is the last block. The
  201.   first 2 bytes of each block are the track and sector of the next block.
  202.   If the track is zero then this is the last block, and the sector # really
  203.   tells the number of bytes used out of the 254 possible. The use count is
  204.   the number of bytes used plus 1--so if the sector # has a $05, then really
  205.   only $04 bytes were used out of the last block.
  206.  
  207.   The directory is at offset $16500 in the .d64 files. Tracks references
  208.   start at 1. Sector references start at 0. So if the first 2 bytes of a
  209.   block are $06 04, the absolute location is at
  210.       5 * $1500 + 4 * $100.
  211.   (5 because that's $06 minus 1. $1500 because at track $06 there are 21
  212.   sectors per track, or $1500 bytes. 4 because that is the sector number,
  213.   and $100 because that's the number of bytes in a sector.)
  214.  
  215.   The disk has a total of 35 tracks. There are 17 trachs with 21 sectors (357
  216.   sectors total), 7 tracks with 19 sectors (133 sectors total), 6 tracks
  217.   with 18 sectors (108 sectors total), and 5 tracks with 17 sectors (85
  218.   sectors total). So total sectors per disk (or .d64 image) is
  219.     357+133+108+85 = 683 total, or 174,848 bytes total, which is the exact
  220.   size of the .d64 files.
  221.  
  222.  
  223.        File:  *.t64 tape image Total Size: Varies
  224.        ------------------------------------------
  225.        Offset   Bytes      Description
  226.         0         64          Tape Record:
  227.         0         32            Tape description + EOF (for type)
  228.        32          2            Tape version: $0100
  229.        34          2            Max number of files, in LO/HI
  230.        36          2            Number of existing files, in LO/HI
  231.        38          2             -
  232.        40         24            User description, as displayed in file menu
  233.  
  234.        64         32*n       File Record(s) for each of n files:
  235.         +0       1            Slot allocation flag:
  236.                               00 = free entry
  237.                               01 = normal tape file
  238.                               03 = memory snapshot v0.9, uncompressed
  239.                               02..FF = reserved for memory snapshots
  240.         +1       1            File type
  241.         +2       2            Start address in C64 memory, in LO/HI
  242.         +4       2            End address in C64 memory, in LO/HI
  243.         +6       2             -
  244.         +8       4            File start address on the image, in LO/HI
  245.        +12       4             -
  246.        +16      16            C64 filename
  247.  
  248.       64+32*n   ???      File contents.
  249.  
  250.  
  251.    Wolfgang Lorenz (author of PC64) posted the following in an open letter
  252.    to Miha Peternel (author of C64S).  AFAIK there's been no reply.
  253.  
  254.    There is some ambiguity in the T64 file format. Could you please make a
  255.    statement if the following assumptions are correct?
  256.  
  257.    Tape Record
  258.  
  259.    Offset, size, description
  260.         0, 32    DOS tape description, ASCII charset, contains either
  261.                  "C64S tape file",13,10,"Demo tape",26,"......" (no 0!) or
  262.                  "C64S tape image file",0,0,0,0,0,0,0,0,0,0,0,0 or
  263.                  "C64 tape image file",13,10,0,0,0,0,0,0,0,0,0,0,0
  264.                  To identify a T64 file, search for the sub-strings "C64" and
  265.                  "tape".
  266.        32, 2     tape version, currently $0100 or $0101
  267.        34, 2     number of directory entries, mostly $001E
  268.        36, 2     number of used entries (0 for unknown)
  269.        38, 2     free
  270.        40, 24    user description as displayed in tape menu, CBM charset,
  271.                  padded with space
  272.  
  273.    File Record
  274.  
  275.    Offset, size, description
  276.         0, 1     entry type
  277.                  0 = free entry
  278.                  1 = normal tape file
  279.                  3 = memory snapshot v0.9, uncompressed
  280.                  2..255 reserved (for memory snapshots...)
  281.         1, 1     C64 secondary address, mostly 1
  282.         2, 2     start address
  283.         4, 2     end address
  284.         6, 2     free
  285.         8, 4     offset of file contents start within T64 file
  286.        12, 4     free
  287.        16, 16    C64 file name, CBM charset, padded with space
  288.  
  289.    Example Structure Definitions for C and C++
  290.  
  291.    struct {
  292.      char acTag[32];
  293.      word wVersion;
  294.      word wEntries;
  295.      word wUsedEntries;
  296.      word wReserved;
  297.      byte abName[24];
  298.    } T64Header;
  299.  
  300.    struct {
  301.      byte bType;
  302.      byte bSecAdr;
  303.      word wStartAdr;
  304.      word wEndAdr;
  305.      word wReserved;
  306.      long lOffset;
  307.      long lReserved;
  308.      byte abName[16];
  309.    } T64Entry;
  310.  
  311.  
  312.        File:  CBM Files      Total Size: Varies
  313.        ---------------------------------------
  314.        Offset   Bytes      Description
  315.         0          2          Load address in LO/HI format.
  316.  
  317.  
  318.        File:  *.p00 file image Total Size: Varies
  319.        ------------------------------------------
  320.        Offset   Bytes      Description
  321.         0          9         String "C64File" terminated by 00.
  322.         9         17         Original C64 Filename.
  323.        10          1         Record size for REL files.
  324.        26                  Original file
  325.  
  326.  
  327.   5.4 Converting between file formats.
  328.  
  329.   Instructions on how to interconvert between all of the formats used
  330.   by the various C64 emulators.
  331.   
  332.   One thing to keep in mind is that there are some 'all in one' conversion
  333.   programs which convert from any format to another; 64Copy is an example.
  334.  
  335.   Formats:
  336.  
  337.   1) .d64 - Disk image used by C64s 
  338.   2) .t64 - Tape image used by C64s
  339.   3) .p00 - image format used by PC64
  340.  
  341.   Conversions:
  342.  
  343.   1) .p00 to .t64
  344.    a) Start PC64
  345.    b) First get a "Manager" window up
  346.    c) Place the cursor on the *.P00 file you want converted
  347.    d) Then use "Manager/Export" (ALT-M-E). This will save it as a *.PRG.
  348.    e) Then use MAKETAPE.EXE to make a *.t64 file.
  349.  
  350.   2) .t64 to .p00
  351.    Use t64top00.exe, which comes with PC64 and creates p00 copies of all the
  352.    t64 files in a directory tree.
  353.  
  354.